<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%> 
<html>
<head>
<title>可搜索内容</title>
<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
<script type="text/javascript" src="${ctx}/script/common/common.js"></script>
<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
<style type="text/css">
	body{
		background: #F6F6F6;
		margin:0;
		padding:0;
		}
</style>
</head>
<body>
<logic:present name="searchDetail">
<logic:present name="productSearchs">
    <table width="100%" id="searchTable" name="searchTable" align="center">
        <logic:iterate id="search" name="searchDetail">
        	<logic:empty name="search" property="value">
        		<bean:define id="key" name="search" property="keywords" />
        		
        		<logic:notEmpty name="productSearchs" property="${key}">
        			<bean:define id="keyValue" name="productSearchs" property="${key}"/>
        		</logic:notEmpty>
        		<logic:empty name="productSearchs" property="${key}">
        			<bean:define id="keyValue" value=""/>
        		</logic:empty>
        		<tr>
        			<td class="td_01"> 
        				e${search.name} 
        			</td>
        			<td class="td_04">
        				<input name="product.${key}" width="60" type="text" value="${keyValue}"/>${search.unit}
        			</td>
        		</tr>
        	</logic:empty>
        	<logic:notEmpty name="search" property="value">
        	<bean:define id="searchValues" name="search" property="value" />
        		<bean:define id="key" name="search" property="keywords" />
        		<logic:notEmpty name="productSearchs" property="${key}">
        			<bean:define id="keyValue" name="productSearchs" property="${key}"/>
        		</logic:notEmpty>
        		<logic:empty name="productSearchs" property="${key}">
        			<bean:define id="keyValue" value=""/>
        		</logic:empty>
        		<tr>
        			<td class="td_01">
        				${search.name}
        			</td>
        			<td class="td_04">
		        		<select name="product.${key}">
		        		<%
		        			String values;
		        			String[] searchs=searchValues.toString().split(";");
		        			for(int i=0;i<searchs.length;i++){
		        				String Lable=searchs[i];
		        				String value=searchs[i];
		        				if(Lable.indexOf("@@@")!=-1){
								String[] svalues=Lable.split("@@@");
									Lable=svalues[1];
									value=svalues[0];
									%>
									 <option value="<%=value%>"
									 <logic:equal name="productSearchs" property="${key}" value="<%=value%>">selected</logic:equal>><%=Lable%></option>	
									<%
								}
		        			}
						 %>
						</select>
						${search.unit}
				</td>
				</tr>
        	</logic:notEmpty>
        </logic:iterate>
  
	</table>
		</logic:present>
     </logic:present>
     <logic:notPresent name="productSearchs">
     	 <table width="100%" id="searchTable" name="searchTable" align="center">
    	<tr>
        	<th colspan="2"  height="25px">可搜索内容</th>
        </tr>
        <logic:iterate id="search" name="searchDetail">
        	<logic:empty name="search" property="value">
        		<bean:define id="key" name="search" property="keywords" />
        		
        		<tr>
        			<td class="td_01">
        				${search.name}
        			</td>
        			<td class="td_04">
        				<input name="product.${key}" width="60" type="text" />${search.unit}
        			</td>
        		</tr>
        	</logic:empty>
        	<logic:notEmpty name="search" property="value">
        	<bean:define id="searchValues" name="search" property="value" />
        		<bean:define id="key" name="search" property="keywords" />
        		<tr>
        			<td class="td_01">
        				${search.name}
        			</td>
        			<td class="td_04">
		        		<select name="product.${key}">
		        		<%
		        			String values;
		        			String[] searchs=searchValues.toString().split(";");
		        			for(int i=0;i<searchs.length;i++){
		        				String Lable=searchs[i];
		        				String value=searchs[i];
		        				if(Lable.indexOf("@@@")!=-1){
								String[] svalues=Lable.split("@@@");
									Lable=svalues[1];
									value=svalues[0];
									%>
									 <option value="<%=value%>"><%=Lable%></option>	
									<%
								}
		        			}
						 %>
						</select>
						${search.unit}
				</td>
				</tr>
        	</logic:notEmpty>
        </logic:iterate>
  
	</table>
     </logic:notPresent>
  </body>
</html>
